'use strict';

const Service = require('egg').Service;

class home extends Service {
    async index() {
        const { ctx } = this;
        ctx.body = 'hi, egg';
    }
    async getImg(detailid) {
        const sql = `select img from detail where detailid="${detailid}"`;
        // return data;
        return await this.app.mysql.query(sql)
    }
    async getLandlord(detailid) {
        const sql = `select landlord from detail where detailid="${detailid}"`;
        // return data;
        return await this.app.mysql.query(sql)
    }
    async getLocation(detailid) {
        const sql = `select title from detail where detailid="${detailid}"`;
        // return data;
        return await this.app.mysql.query(sql)
    }
}

module.exports = home;
